package org.will.spi.dubbo;

import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.common.extension.ExtensionLoader;
import lombok.extern.slf4j.Slf4j;

import java.net.MalformedURLException;
import java.util.HashMap;
import java.util.Map;

@Slf4j
public class Main {

    private static final HelloService helloService = ExtensionLoader.getExtensionLoader(HelloService.class).getAdaptiveExtension();

    public static void main(String args[]) throws MalformedURLException {
        Map<String, String> params = new HashMap<>();
        params.put("hello", "local");
        params.put("myProtocol", "local");
        URL url = new URL("dubbo", "127.0.0.1", 8888, params);

        String result = helloService.sayHello(url);
        System.out.println(result);
    }
}
